// 在这个文件内书写所有的封装函数
// 把和商品相关的所有请求都封装成 hooks 函数

interface User {
  loginname: string
  password: string
}

// 导入 axios 的实例
import http from '../utils/http'

export const login = (info: User) => http.post('/user/login', info)

export const testTelHanlder = (tel: string) => http.post('/user/docheckphone', { tel })

export const sendCodeHanlder = (tel: string) => http.post('/user/dosendmsgcode', { tel })

export const testCodeHanlder = (tel: string, telcode: string) => http.post('/user/docheckcode', { tel, telcode })

export const registerHanlder = (tel: string, password: string) => http.post('/user/dofinishregister', { tel, password })
